import request from '@/utils/request'

//获取所有学生
export function getAllStudentsAPI() {
  return request({
    url: '/admin/students',
    method: 'get'
  })
}
//新增学生
export function addStudentAPI(data) {
  return request({
    url: '/admin/student',
    method: 'post',
    data
  })
}
//删除学生
export function deleteStudentAPI(id) {
  return request({
    url: `/admin/student/${id}`,
    method: 'delete'
  })
}
//修改学生信息
export function updateStudentAPI(data) {
  return request({
    url: '/admin/student',
    method: 'put',
    data
  })
}
//获取所有教师
export function getAllTeachersAPI() {
  return request({
    url: '/admin/teachers',
    method: 'get'
  })
}
//新增教师
export function addTeacherAPI(data) {
    return request({
        url: '/admin/teacher',
        method: 'post',
        data
    })
}
//删除教师
export function deleteTeacherAPI(id) {
    return request({
        url: `/admin/teacher/${id}`,
        method: 'delete'
    })
}
//修改教师信息
export function updateTeacherAPI(data) {
    return request({
        url: '/admin/teacher',
        method: 'put',
        data
    })
}